import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class GameView extends JFrame implements ActionListener{

        private JPanel contentPane;
        private JButton newButton, loadButton;
        private boolean startNewGame, loadGame;

        public GameView() {
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                setBounds(100, 100, 450, 300);
                contentPane = new JPanel();
                startNewGame = false;
                loadGame = false;
                contentPane.setBackground(new Color(218, 165, 32));
                contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
                setContentPane(contentPane);
                
                newButton = new JButton("New Game");
                newButton.addActionListener(this);
                
                loadButton = new JButton("Load Game");
                loadButton.addActionListener(this);

                GroupLayout gl_contentPane = new GroupLayout(contentPane);
                gl_contentPane.setHorizontalGroup(
                        gl_contentPane.createParallelGroup(Alignment.LEADING)
                                .addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
                                        .addContainerGap(60, Short.MAX_VALUE)
                                        .addComponent(newButton)
                                        .addGap(53)
                                        .addComponent(loadButton)
                                        .addGap(42)
                ));
                gl_contentPane.setVerticalGroup(
                        gl_contentPane.createParallelGroup(Alignment.LEADING)
                                .addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
                                        .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                                                .addComponent(newButton)
                                                .addComponent(loadButton)
                )));
                contentPane.setLayout(gl_contentPane);
        }

        public void actionPerformed(ActionEvent e) 
        {
                if(e.getActionCommand().equals("New Game")) 
                {
                        startNewGame = true;
                }
                else if(e.getActionCommand().equals("Load Game")) 
                {
                		loadGame = true;
                } 
                
        }
        
        public boolean startNewGame()
        {
                return startNewGame;
        }
        
        public boolean loadGame()
        {
                return loadGame;
        }
        
        public void setLoadGame(boolean b)
        {
        	loadGame = b;
        }
}